//404跳转
export const page404 = {
	path: '/*',
	name: 'page404',
	meta: {
		title: '404-页面不存在'
	},
	component: () =>
		import ('@/pages/404')
}

//app路由
export const appRouter = [{
		path: '/',
		redirect: "/login",
	},
	{
		path: '/login',
		name: 'Login',
		component: () =>
			import ('@/pages/Login')
	},
	{
		path: '/home',
		// name: 'Home',
		meta: {
			requireAuth: true,
		},
		component: () =>
			import ('@/pages/Home'),
		children: [{
				path: '/',
				name: 'Home',
				meta: {
					requireAuth: true,
				},
				component: () =>
					import ('@/pages/subPages/Home')
			}, {
				path: 'userList',
				name: 'UserList',
				meta: {
					requireAuth: true,
				},
				component: () =>
					import ('@/pages/subPages/UserList')
			}, {
				path: 'polist',
				name: "PoList",
				meta: {
					requireAuth: true,
				},
				component: () =>
					import ('@/pages/subPages/PoList')
			},
			{
				path: 'podetails',
				name: "PoDetails",
				meta: {
					requireAuth: true,
				},
				component: () =>
					import ('@/pages/subPages/PoDetails')
			},
		]
	},
	{
		path: '/test',
		name: 'Test',
		meta: {
			requireAuth: true,
		},
		component: () =>
			import ('@/pages/Test')
	},
	{
		path: '/echart',
		name: 'Echart',
		component: () =>
			import ('@/components/Echart')
	},
	{
		path: '/transfer',
		name: 'transfer',
		component: () =>
			import ('@/components/Transfer')
	},
	{
		path: '/*',
		name: '404',
		component: () =>
			import ('@/pages/404')
	}
];

// 所有上面定义的路由都要写在下面的routers里
export const routers = [
	page404,
	appRouter
];